Get clazy working again (#1375)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sun, 10 Nov 2024 19:30:21 +0000 (12:30 -0700)
committerGitHub <noreply@github.com>
Sun, 10 Nov 2024 19:30:21 +0000 (12:30 -0700)
12 files changed:
.github/workflows/ubuntu.yml
geo.cc
geo.h
googletakeout.cc
mtk_logger.cc
mtk_logger.h
tools/Dockerfile_noble
tools/make_docker_image
unicsv.cc
v900.cc
v900.h
vecs.cc

index 0e18db5177dbe928adcedb5d5ced86359dbb1e1d..6f28d773e3885bf031b6d3cf63b6740759055fff 100644 (file)
@@ -35,7 +35,7 @@ jobs:
             CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
             SCRIPT: './tools/build_and_test_cmake.sh'
             TOOLS: 'clang'
-          - IMAGE: 'jammy'
+          - IMAGE: 'noble'
             CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
             SCRIPT: './tools/build_extra_tests.sh'
     container:
diff --git a/geo.cc b/geo.cc
index 3f084bc2c37b3046f92daaee002b84044f0629a2..95e76ac9f06027eb61c5f214686a31e2dc04bbf7 100644 (file)
--- a/geo.cc
+++ b/geo.cc
@@ -22,9 +22,9 @@
 #include <QByteArray>            // for QByteArray
 #include <QIODevice>             // for QIODevice
 #include <QString>               // for QString, operator==, QStringView::to...
+#include <QStringLiteral>        // for qMakeStringPrivate, QStringLiteral
 #include <QStringView>           // for QStringView
 #include <QXmlStreamAttributes>  // for QXmlStreamAttributes
-#include <QtCore>                // for qPrintable, QIODeviceBase::ReadOnly
 
 #include "defs.h"
 #include "geocache.h"            // for Geocache, Geocache::container_t, Geo...
diff --git a/geo.h b/geo.h
index 8267cfc4c1a5a9ff1820629e6e08f3d5bb27402f..3b86c6a91553b068fc662db4bf18d72ad1481e3d 100644 (file)
--- a/geo.h
+++ b/geo.h
@@ -19,6 +19,7 @@
 #ifndef GEO_H_INCLUDED_
 #define GEO_H_INCLUDED_
 
+#include <QList>             // for QList
 #include <QString>           // for QString
 #include <QVector>           // for QVector
 #include <QXmlStreamReader>  // for QXmlStreamReader
index b00e86f282f2f054dcbcc1489dfe69e512105498..57fa02f21fa6364d0af8a44bb4931cfc06b7f917 100644 (file)
 #include <QDebug>               // for QDebug
 #include <QDir>                 // for QDir
 #include <QFileInfo>            // for QFileInfo
-#include <QFileInfoList>        // for QFileInfoList
 #include <QIODevice>            // for operator|, QIODevice
 #include <QJsonArray>           // for QJsonArray, QJsonArray::const_iterator
 #include <QJsonDocument>        // for QJsonDocument
 #include <QJsonObject>          // for QJsonObject, QJsonObject::const_iterator
 #include <QJsonParseError>      // for QJsonParseError, QJsonParseError::NoError
-#include <QJsonValueRef>        // for QJsonValueRef
-#include <QtCore>               // for ISODate, QIODeviceBase::ReadOnly, QIODeviceBase::Text
+#include <Qt>
 
 #include "src/core/datetime.h"  // for DateTime
 #include "src/core/file.h"      // for File
index 5db9163ca729a0c3f42ee4b863c11c21cba2c070..c9704cd61ad200ebcd52787d2d1b73547ebfb800 100644 (file)
 
 #include "mtk_logger.h"
 
-#include <algorithm>            // for clamp
-#include <cctype>               // for isdigit
-#include <cstdarg>              // for va_end, va_start
-#include <cstring>              // for memcmp, memset, strncmp, strlen, memmove, strchr, strcpy, strerror, strstr
+#include <algorithm>           // for clamp
+#include <cctype>              // for isdigit
+#include <cerrno>              // for errno
+#include <cmath>               // for fabs
+#include <cstdarg>             // for va_end, va_start
+#include <cstring>             // for memcmp, memset, strncmp, strlen, memmove, strchr, strcpy, strerror, strstr
+#include <cstdlib>             // for strtoul
 #if __WIN32__
-#include <io.h>                 // for _chsize
+#include <io.h>                // for _chsize
 #else
-#include <unistd.h>             // for ftruncate
+#include <unistd.h>            // for ftruncate
 #endif
 
-#include <QByteArray>           // for QByteArray
-#include <QChar>                // for QChar
-#include <QDateTime>            // for QDateTime
-#include <QDir>                 // for QDir
-#include <QFile>                // for QFile
-#include <QLatin1Char>          // for QLatin1Char
-#include <QStringLiteral>       // for qMakeStringPrivate, QStringLiteral
-#include <QThread>              // for QThread
-#include <QtCore>               // for qPrintable, UTC
-#include <cerrno>               // for errno
-#include <cmath>                // for fabs
-#include <cstdlib>              // for strtoul
+#include <QByteArray>          // for QByteArray
+#include <QChar>               // for QChar
+#include <QDateTime>           // for QDateTime
+#include <QDir>                // for QDir
+#include <QFile>               // for QFile
+#include <QLatin1Char>         // for QLatin1Char
+#include <QMessageLogContext>  // for QtMsgType
+#include <QStringLiteral>      // for qMakeStringPrivate, QStringLiteral
+#include <QThread>             // for QThread
+#include <QtGlobal>            // for qPrintable
 
 #include "defs.h"
-#include "gbfile.h"             // for gbfprintf, gbfputc, gbfputs, gbfclose, gbfopen, gbfile
-#include "gbser.h"              // for gbser_read_line, gbser_set_port, gbser_OK, gbser_deinit, gbser_init, gbser_print, gbser_TIMEOUT
-#include "src/core/datetime.h"  // for DateTime
+#include "gbfile.h"            // for gbfprintf, gbfputc, gbfputs, gbfclose, gbfopen, gbfile
+#include "gbser.h"             // for gbser_read_line, gbser_set_port, gbser_OK, gbser_deinit, gbser_init, gbser_print, gbser_TIMEOUT
+#include "src/core/datetime.h" // for DateTime
 
 
 #define MTK_EVT_BITMASK  (1<<0x02)
index 662e4606e0727a0e8cf80c8f19bfdec842c91f52..73d9e51d7e0aeb6c86821e06b0a2c620246b4650 100644 (file)
@@ -57,6 +57,7 @@
 #include <cstdio>    // for FILE
 #include <ctime>     // for time_t
 
+#include <QList>     // for QList
 #include <QString>   // for QString
 #include <QVector>   // for QVector
 
index ac01c7e9288b435f5d3930017f49b3f0f3b49e76..af41797702380847dbf26ec3c1a8256d1ba5b549 100644 (file)
@@ -7,9 +7,15 @@ LABEL maintainer="https://github.com/tsteven4"
 WORKDIR /app
 
 # update environment.
+# software-properties-common, gpg-agent and ppa:tsteven4/clazy-backports
+# are needed to get a backported version of clazy (1.12-2~noble12) that works
+# with Qt6.
 ARG DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && apt-get install -y --no-install-recommends \
     apt-utils \
+    software-properties-common \
+    gpg-agent \
+ && add-apt-repository ppa:tsteven4/clazy-backports \
  && apt-get upgrade -y \
  && rm -rf /var/lib/apt/lists/*
 
index 437722b00454a1eba03a758024364952a6bda6ba..cc8aa4c742098e53fbc074b0b6e7ccccdbe44578 100755 (executable)
@@ -7,9 +7,11 @@ TMPDIR=$(mktemp -d)
 
 cp Dockerfile${versuffix} $TMPDIR
 
-docker build --pull --file Dockerfile${versuffix} \
+docker buildx build \
+             --pull --file Dockerfile${versuffix} \
              --tag tsteven4/gpsbabel_build_environment${versuffix}:latest \
              --tag tsteven4/gpsbabel_build_environment${versuffix}:$tag \
+             --progress=plain \
              $TMPDIR
 /bin/rm -fr $TMPDIR
 docker push tsteven4/gpsbabel_build_environment${versuffix}:$tag
index 34b557ef70f91f364e43c413a4a768738f26eb77..a9d71b0e295c7861f915e318e4185143398648ca 100644 (file)
--- a/unicsv.cc
+++ b/unicsv.cc
@@ -404,7 +404,7 @@ UnicsvFormat::unicsv_fondle_header(QString header)
     }
   }
 
-  for (auto value : values) {
+  for (auto value : std::as_const(values)) {
     value = value.trimmed();
 
     unicsv_fields_tab.append(fld_terminator); // default
diff --git a/v900.cc b/v900.cc
index bcc248aa7fe337d32f258124acd2e4ab31d34f28..c961fe31603d23b3e6663f7380049895a590fdf6 100644 (file)
--- a/v900.cc
+++ b/v900.cc
@@ -73,16 +73,16 @@ for a little more info, see structures:
 
 #include "v900.h"
 
-#include <cassert>     // for assert
-#include <cstdarg>     // for va_end, va_start
-#include <cstdio>      // for fclose, fgets, fread, va_list
-#include <cstdlib>     // for strtod
-#include <cstring>     // for strncmp, strcat, strcpy, strstr
-
-#include <QByteArray>  // for QByteArray
-#include <QDate>       // for QDate
-#include <QTime>       // for QTime
-#include <QtCore>      // for qPrintable, UTC
+#include <cassert>             // for assert
+#include <cstdarg>             // for va_end, va_start
+#include <cstdio>              // for fclose, fgets, fread, va_list
+#include <cstdlib>             // for strtod
+#include <cstring>             // for strncmp, strcat, strcpy, strstr
+
+#include <QByteArray>          // for QByteArray
+#include <QDate>               // for QDate
+#include <QMessageLogContext>  // for QtMsgType
+#include <QTime>               // for QTime
 
 #include "defs.h"
 
diff --git a/v900.h b/v900.h
index 5a2b578f71aa662e72d7720fc8badccbdb9de539..8501eb9dc019f7709d64ffc15928d889113d1859 100644 (file)
--- a/v900.h
+++ b/v900.h
@@ -27,6 +27,7 @@
 #include <cstdio>     // for FILE
 
 #include <QDateTime>  // for QDateTime
+#include <QList>      // for QList
 #include <QString>    // for QString
 #include <QVector>    // for QVector
 
diff --git a/vecs.cc b/vecs.cc
index 1617d02a6f6f3e498ea82fa3911e2ed7060ea2ba..f13c026f66f89934c00901b4ebc2d9fda9190fe0 100644 (file)
--- a/vecs.cc
+++ b/vecs.cc
@@ -767,7 +767,7 @@ QVector<Vecs::style_vec_t> Vecs::create_style_vec()
   dir.setNameFilters(QStringList("*.style"));
   dir.setFilter(QDir::Files);
   dir.setSorting(QDir::Name);
-  QFileInfoList fileinfolist = dir.entryInfoList();
+  const QFileInfoList fileinfolist = dir.entryInfoList();
   QVector<style_vec_t> slist;
   for (const auto& fileinfo : fileinfolist) {
     if (!fileinfo.isReadable()) {